﻿using System;
using System.Collections.Generic;
using System.Text;

namespace csharpcore7_ch6
{
    class DateTimeZone
    {
        static void _Main()
        {
            DateTime dt1 = new DateTime(2000, 1, 1, 10, 20, 30, DateTimeKind.Local);
            DateTime dt2 = new DateTime(2000, 1, 1, 10, 20, 30, DateTimeKind.Utc);
            Console.WriteLine(dt1 == dt2);
            DateTime local = DateTime.Now;
            Console.WriteLine(local);
            DateTime utc = local.ToUniversalTime();//将日期转换为UTC时间
            Console.WriteLine(utc);
            Console.WriteLine(local == utc); //False


            DateTime d = new DateTime(2015, 12, 12); //Unspecified
            DateTime utc1 = DateTime.SpecifyKind(d, DateTimeKind.Utc);
            Console.WriteLine(utc1);


        }
    }


}
